package com.pqc.tbk.service.admin;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.pqc.tbk.dao.AdviceDao;
import com.pqc.tbk.entity.Advice;
import com.pqc.tbk.utils.StringUtil;

@Service
public class AdviceServiceImpl implements AdviceService {

	@Autowired
	private AdviceDao adviceDao;

	@Override
	public void save(String name, String content, final String ip) {
		final Advice advice = new Advice();

		name = StringUtil.htmlspecialchars(name);
		content = StringUtil.htmlspecialchars(content);

		advice.setContent(content);
		advice.setName(name);
		advice.setIp(ip);
		adviceDao.save(advice);
	}

}
